package ch3.section3.myArrayList;

import java.util.ArrayList;

public class Test {
    public static void main(String[] args){
        MyArrayList<Integer> myArr = new MyArrayList<>();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0;i < 10; i++){
            myArr.add(i);
            list.add(i);
        }

        System.out.println(myArr.get(3));
        System.out.println(list.get(3));

        myArr.set(5,198);
        list.set(5,198);

        System.out.println(myArr.get(5));
        System.out.println(list.get(5));

        myArr.remove(5);
        list.remove(5);

        System.out.println(myArr.get(5));
        System.out.println(list.get(5));

        System.out.println(myArr.size());
        System.out.println(list.size());

        myArr.clear();
        list.clear();

        System.out.println(myArr.size());
        System.out.println(myArr.size());

    }
}
